package com.mv.controller;

import com.mv.pojo.Card;
import com.mv.pojo.Care;
import com.mv.pojo.Wares;
import com.mv.service.CareService;
import com.mv.vo.SysResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/mv")
public class CareController {
    @Autowired
    private CareService careService;
    @GetMapping("/care/getCareListByIntegral")
    public SysResult getCareListByIntegral(){
        List<Care> careList = careService.getCareListByIntegral();
        return SysResult.success(careList);
    }
    @GetMapping("/care/getCareListByWares")
    public SysResult getCareListByWares(){
        List<Care> careList=careService.getCareListByWares();
        return SysResult.success(careList);
    }
    @PostMapping("/care/saveCareIntegral")
    public SysResult saveCareIntegral(@RequestBody Card card){
        careService.saveCareIntegral(card);
        return SysResult.success();
    }
    @PostMapping("/care/saveCareWares")
    public SysResult saveCareWares(@RequestBody Wares wares){
        careService.saveCareWares(wares);
        return SysResult.success();
    }
}
